/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.mapper;

import org.apache.ibatis.annotations.Param;
import org.springblade.modules.admin.dto.parts.PlanFlowDetailSearchDTO;
import org.springblade.modules.admin.dto.parts.SparepartPricesSearchDTO;
import org.springblade.modules.admin.entity.SparepartPrices;
import org.springblade.modules.admin.vo.SparepartPricesVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.admin.vo.parts.PlanFlowDetailVo;
import org.springblade.modules.admin.vo.parts.SparepartPricesListVo;

import java.util.List;

/**
 *  Mapper 接口
 *
 * @author ysq
 * @since 2022-06-28
 */
public interface SparepartPricesMapper extends BaseMapper<SparepartPrices> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param sparepartPrices
	 * @return
	 */
	List<SparepartPricesVO> selectSparepartPricesPage(IPage page, @Param("sparepartPrices") SparepartPricesSearchDTO sparepartPrices);

	/**
	 * 获取报价记录
	 * @param page 分页
	 * @param sparepartPrices 查询条件
	 * @return 数据集
	 */
    List<SparepartPricesListVo> list(IPage<SparepartPricesListVo> page, @Param("sparepartPrices")SparepartPricesSearchDTO sparepartPrices);

	/**
	 * 获取审批的报价信息
	 * @param parentPlanId
	 * @param groupId
	 * @return
	 */
	List<SparepartPrices> getSparepartPricesDetail(@Param("parentPlanId") Long parentPlanId,@Param("groupId") Long groupId);


	/**
	 * 获取审批的报价信息
	 * @param planId
	 * @return
	 */
	List<SparepartPrices> getSparepartPricesDetailV2(@Param("planId") Long planId);

	/**
	 * 配件调度列表
	 * @param page 分页
	 * @param sparepartPrices 查询条件
	 * @return 数据集
	 */
    List<SparepartPricesVO> dispatchList(IPage<SparepartPricesVO> page, @Param("sparepartPrices")SparepartPricesSearchDTO sparepartPrices);


	/**
	 * 获取仓管流程信息用于审批
	 * @param planFlowDetailSearchDTO 查詢條件
	 * @return 数据集
	 */
	PlanFlowDetailVo getPlanFlowDetail(@Param("planFlowDetailSearchDTO") PlanFlowDetailSearchDTO planFlowDetailSearchDTO);

	/**
	 * 获取报价流程信息用于审批
	 * @param planFlowDetailSearchDTO 查詢條件
	 * @return 数据集
	 */
	PlanFlowDetailVo getPricesPlanFlowDetail(@Param("planFlowDetailSearchDTO") PlanFlowDetailSearchDTO planFlowDetailSearchDTO);

	/**
	 * 配件任务列表
	 * @param page 分页条件
	 * @param sparepartPrices 查询条件
	 * @return 数据集
	 */
    List<SparepartPricesVO> planPage(IPage<SparepartPricesVO> page, @Param("sparepartPrices") SparepartPricesSearchDTO sparepartPrices);

	/**
	 * 获取配件工单的所有状态
	 * @return
	 */
	List<Integer> getPlanPartSummary(Integer typeStatus);

	/**
	 * 根据父级id获取关联的配件
	 * @param parentId 父级id
	 * @return 数据集
	 */
	List<SparepartPricesVO> getRelationPartsByParentId(Long parentId);

	/**
	 * 配件列表V2
	 * @param page 分页参数
	 * @param sparepartPrices 查询
	 * @return 结果
	 */
	List<SparepartPricesVO> dispatchListV2(IPage<SparepartPricesVO> page, SparepartPricesSearchDTO sparepartPrices);
}
